package com.zsc.shixun.exception;

import com.zsc.shixun.common.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author DeadRabbit
 * Date on 2019/12/11  16:11
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ApiException extends RuntimeException {

    public ApiException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.code = resultCode.getCode();
    }

    public ApiException(ResultCode resultCode, String data) {
        super(resultCode.getMsg());
        this.code = resultCode.getCode();
        this.data = data;
    }

    private Integer code;

    private String data;
}